/**
 * User micro profile
 *
 * This class represent a user with a name, a alias and some interests
 */
class MicroProfile
{
  // Name and alias of the user
  String name;
  String alias;
  
  // Interest tags
  int numTags;
  String[] tags;
  
  /**
   * Create an empty profile
   */
  MicroProfile()
  {
    // Create almost an array with two tags
    // to allow exapand the array
    tags = new String[2];
  }
  
  /**
   * Adds the specified tag to the list
   *
   * @param tag Interest tag
   */
  void addTag(String tag)
  {
    // If the array is full, expand it
    if(numTags == length(tags))
      tags = expand(tags);
     
    // Add the tag, update counter
    tags[numTags++] = tag;
  }

  /**
   * Remove the tag in the position specified
   * 
   * @param index The tag index to remove
   */ 
  void deleteTag(int index)
  {
    // Move the tags over the removed element
    for(int i=index; i<numTags-1; i++)
      tags[i] = tags[i+1];
    
    // Update the counter
    numTags--;
  }
}
